Skip to content

Fix logging when an OFF connection initializes first - #1670

Open
cathleeny wants to merge 2 commits into
mainfrom
SC-241918-logging-off-to-enabled
Open

Fix logging when an OFF connection initializes first#1670
cathleeny wants to merge 2 commits into
mainfrom
SC-241918-logging-off-to-enabled

Conversation

@cathleeny

@cathleeny cathleeny commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix process-wide JUL initialization when the first connection uses LogLevel=OFF.

  • OFF suppresses the shared parent logger without creating a handler or permanently completing initialization.
  • The first logging-enabled connection installs the single shared handler.
  • Once enabled, later connections—including OFF connections—do not reconfigure the logger.
  • Failed handler creation remains retryable.

Testing

  • Unit tests cover OFF -> TRACE, TRACE -> OFF, concurrent initialization without duplicate handlers, and retry after failed handler creation.
  • JulLoggerTest and LoggingUtilTest: 30 tests passed.
  • Thin and uber JARs were manually verified: OFF -> TRACE creates one handler, while TRACE -> OFF retains the original handler and level.

Additional Notes to the Reviewer

This is the short-term fix and intentionally keeps handler creation inside JulLogger.initLogger().

Signed-off-by: Cathleen Yan <cathleen.yan@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant